    // ==UserScript==
    // @name         New Userscript
    // @namespace    http://tampermonkey.net/
    // @version      0.+
    // @description  try to take over the world!
    // @author       You
    // @match        http://image.baidu.com/search/index?*
    // @require      https://code.jquery.com/jquery-3.3.1.min.js
    // @grant        none
    // ==/UserScript==

    (function () {
        'use strict';

        //提交按钮添加到页面
        $("#imgfilter-btn").after("<button class='tjButton' type='button' value='' name='test' style='width:80px;height:30px;background-color:#ff6e2e;'>提交</button>");

        //获取图片真实地址
        var img_urls = $(".imgbox a");
        for (var i = 0; i < img_urls.length; i++) {
            var url_href = img_urls[i].href;
            var url = url_href.split("objurl=")[1].split("&")[0];
            console.log(decodeURIComponent(url));
        }

        var decodeUrl = decodeURIComponent(url);

        var checkbox_val = document.querySelectorAll(".checkbox").value = decodeUrl;
        // console.log(checkbox_val);

        //将选中img真实URL一键获取
        $(".tjButton").click(function () {
            var obj = document.querySelectorAll(".checkbox").value = checkbox_val;
            var check_val = [];
            var k;
            for (k in obj) {
                if (obj[k].checked)
                    check_val.push(obj[k].value);
            }
            alert(check_val);
            // alert(decodeUrl);
        });

        //img_checkbox
        $(".imgitem").each(function () {
            console.log(1);
            var i = 0;
            i++;
            $(this).append("<input class='checkbox' type='checkbox' name='test' value='' checked=''/>");
        });

        // $(".checkbox").click(function () {
        //     alert(checkbox_val[i]);
        // });

        // function onCheckbox(obj) {
        //     if (obj.checked) {
        //         console.log("selected");
        //     } else {
        //         console.log("unselected");
        //     }

        // }

        $(":checkbox").on("change", function () {
            var $checkbox = $(this);
            console.log($('input:checked').value = decodeUrl);
        });

        // js监测checkbox是否被选中
        $(".checkbox").prop("checked", false);

        $(".checkbox").css({
            width: "100px",
            height: "60px",
            position: "absolute",
            top: "0",
        });
    })();